<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: Menus.php 2010-08-31 16:05 idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 */

class Page_Plugin_Menus {
	// page_profile
	public function onMenuInitialize_PageProfileEdit($row) {
		$subject = Engine_Api::_ ()->core ()->getSubject ();
		
		if ($subject->isTeamMember ()) {
			return array ('label' => 'Edit Page', 'icon' => 'application/modules/Page/externals/images/editinfo.png', 'route' => 'page_team', 'params' => array ('action' => 'edit', 'page_id' => $subject->getIdentity () ) );
		}
		
		return false;
	}
	
	public function onMenuInitialize_PageProfileShare($row) {
		$subject = Engine_Api::_ ()->core ()->getSubject ();
		$viewer = Engine_Api::_ ()->user ()->getViewer ();
		
		if ($viewer->getIdentity ()) {
			return array ('label' => 'Share Page', 'icon' => 'application/modules/Page/externals/images/share.png', 'class' => 'smoothbox', 'route' => 'default', 'params' => array ('module' => 'activity', 'controller' => 'index', 'action' => 'share', 'type' => $subject->getType (), 'id' => $subject->getIdentity (), 'format' => 'smoothbox' ) );
		}
		
		return false;
	}
}